package main;


import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import main.manage.ManageController;
import main.model.DataModel;
import main.model.ExampleDataFactory;
import main.murder.MurderController;
import main.offender.Offender;
import main.offender.OffenderController;
import main.taxevation.TaxEvationController;




 public class Main extends Application {

	
	@FXML
	Button mainMenuButton;
	
	@FXML
	Button murderButton;
	
	@FXML
	Button taxEvationButton;
	
	@FXML
	Button manageViewButton;
	
	@FXML 
	Button offenderButton; 
	
	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage stage) throws Exception {
		
//		// Loading out GUI from the fxml file.
//		Parent root = FXMLLoader.load(getClass().getResource("Main.fxml"));
//		Scene scene = new Scene(root, 550, 700);
//
//		stage.setTitle("Only For Testing!");
//		stage.setScene(scene);
//		stage.show();
	    
	    new ManageController().openDialog();
		
		// set Example Data
		DataModel.getInstance().getOffenderList().addAll(ExampleDataFactory.getOffenderList());
		DataModel.getInstance().getCrimeList().addAll(ExampleDataFactory.getCrimeList());
	}
	
	
	
	
    @FXML
    void openMainMenu(ActionEvent event) {

    }
    
    @FXML 
    void offenderButtonOnAction(ActionEvent action){
    	
    	new OffenderController().openDialog();
    	
    }

    @FXML
    void onOpenMurder(ActionEvent event) {
    
    	new MurderController().openDialog();

    }

    @FXML
    void onOpenTaxEvationButton(ActionEvent event) {
    	
    	new TaxEvationController().openDialog();

    }

    @FXML
    void onOpenManageView(ActionEvent event) {
    	
    	new ManageController().openDialog();

    }


	
}
